package com.wf.javase;

/**
 * @author mpk
 * @since 2024/6/22 16:05:29
 */
/*2.如何在线程B之后执行线程A，线程C在线程B之前执行？ c-->b-->A*/
public class Demo1 {

    public static void main(String[] args) throws InterruptedException {
        MyThread a = new MyThread("A");
        MyThread b = new MyThread("B");
        MyThread c = new MyThread("C");

        c.start();
        c.join();

        b.start();
        b.join();

        a.start();
        a.join();

    }

}

class MyThread extends Thread {

    public MyThread(String c) {
        super(c);
    }

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() +"线程执行");
    }
}
